package org.lifecycle;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Spring容器启动类_观察Bean生命周期 {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("org.lifecycle");
        //销毁容器，就会执行bean的销毁方法
        context.close();
    }
}
